import axios from "axios";


export const login = payload=>{
    const{url,data}=payload;
    return axios({ method: 'POST', url, data }).then(res => res.data)
}

export const register = payload=>{
    console.log(payload.password)
    const{url,data}=payload;
    return axios({ method: 'POST', url, data }).then(res => res.data)
}

export const getCaptcha = payload => {
    console.log(payload);
    return axios.post(`/captcha`, ).then(res => res.data
    )
        ;
}

export const validUsername = payload => {
    console.log(payload);
    return axios.post(`/api/validUsername`,payload).then(res => res.data
    )
}
